gusucode.com > 忠网网站广告管理系统 ZonGG V1.3 > 忠网网站广告管理系统 ZonGG V1.3\code\智能化安装向导.asp

    <!-- #include file="include/Config.asp" -->
<!-- #include file="include/Function.asp" -->
<%
 ''///********************************************************
 ''    安装向导
 ''********************************************************///

 Server.ScriptTimeOut=1000
%>
<html>
<head>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content="text/html; charset=gb2312" charset=gb2312>
<title>忠网广告系统 缩写:ZonGG - 智能化安装向导</title>
<meta http-equiv=Pragma content=no-cache>
<STYLE>
<!--

body,p,td { font-family:Verdana, Arial, Helvetica, sans-serif, 宋体; font-size:8pt; color:#000000 }

body
{ 
	SCROLLBAR-FACE-COLOR:#ffffff;
	SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
	SCROLLBAR-SHADOW-COLOR: #4F7EB9;
	SCROLLBAR-3DLIGHT-COLOR: #ffffff;
	SCROLLBAR-ARROW-COLOR: #4F7EB9;
	SCROLLBAR-TRACK-COLOR: #ffffff;
	SCROLLBAR-DARKSHADOW-COLOR: #ffffff;	
	
	background-color:#FFFFFF;
	background-attachment: fixed; 
	background-repeat: no-repeat;
	background-position: right bottom 

 }

INPUT
{ BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px;
 BORDER-LEFT-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px;
 PADDING-BOTTOM: 1px; PADDING-TOP: 1px; HEIGHT: 18px;
 BORDER-LEFT-COLOR: #c0c0c0; BORDER-BOTTOM-COLOR: #c0c0c0;
 BORDER-TOP-COLOR: #c0c0c0; BORDER-RIGHT-COLOR: #c0c0c0;
 background-color: #ffffff; CURSOR: HAND;
 FONT-SIZE: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; COLOR: #000000;
}

A:hover {text-decoration: underline; color:#007dff}

a { COLOR: #333333; TEXT-DECORATION: none }



--></STYLE>
<base target="_parent">
</head>
	<body><center>
	<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="680" align=center>
	<tr height=50><td colspan="3" >
	<table style="BORDER-COLLAPSE: collapse" cellspacing=0 cellpadding=0 width="100%" align=center border=0>
	<tbody> 
	<tr> 
	<td width=5 background="pic/top_left.jpg"> </td>
	<td background="pic/top_mid.jpg"  style="color: #FFFFFF; font-size: 12pt" width=200><img border="0" src="logo.gif" width="200" height="50"></td>
	
	<td background="pic/top_mid.jpg"  style="color: #FFFFFF; font-size: 9pt"  align=center></td> <td  background="pic/top_mid.jpg" valign="bottom" width=300 align=center  style="color: #FFFFFF; font-size: 8pt"><%=Version%></td>
	
	<td width=21><img height=50  src="pic/top_right.jpg"  width=21></td>
	
	</tr><tr  bgcolor=#ffcc00 height=1><td  width=10></td><td  colspan="3"></td><td></td></tr>
	</tbody>
	</table>
	
	</td></tr>
	<tr><TD bgColor=#3373ce width="2"><img border="0" src="pic/k.gif" width=2></TD>
	<td width=100% valign="top">
	 <table width=100% id="table4">
	<tr><td align="center">
	<font color="#3373CE"><b><font size="4">ZonGG V1.3 </font> <font color="#3373CE" size="4"> 智能化安装向导</font></font></b></td></tr>
	<tr><td align="center">
	<hr color="#3373CE" size="1" width="80%">
	<font color="#3373CE">为了系统安全,安装成功后,该向导会进行“自杀”</font></td></tr>
	<tr><td>
	
	<%
	Select Case Trim(request("a"))
		
		Case "1"
			call a1()
		Case "2"
			call a2()
		Case "3"
			call a3()
		Case "4"
			call a4()
		Case "5"
			call a5()			
		Case "6"
			call a6()
		Case else
			call a0()
				
	End Select
	
	
	Sub a0()

	
	%>
	<form method="POST" action="?a=1">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font size="2" color="#FF9900"><b>安装前必读</b></font></td>
	</tr>
	<tr>
	<td height="60">
	<textarea rows="8" name="S1" cols="72">
第一部分 系统专有

系统名称:忠网广告系统 缩写:ZonGG
软件性质:共享软件
当前版本:ZonGG V1.3  发行日期:2006-06-8
开 发 者:可乐(原:黑子)(北京对号科技有限责任公司)
版权所有:2003年~2006年
版权所有:北京对号科技有限责任公司  
官方网址:http://gg.zon.cn    http://soft.duihao.com 


第二部分 权责明细

1、授权方式:共享软件,商业注册后可享受各种相关技术支持。

2、授权对象:全球技术爱好者,个人、公司、组织、政府机构等。

3、授予权利:自行使用、向其他人分发、提供下载、转载及其他任何方式的传播。

4、使用者在确定使用本系统时,应以指定方式告之开发者系统使用的域名、IP及相关信息。

5、使用者在使用过程中可以享受到开发者提供的各类关于本系统的BUG修复及更新升级。

6、使用者有权利和义务通过开发者指定的方式向其反馈使用中发现的BUG及其它各类相关需求信息,开发者将根据这些对系统进行升级修缮。

7、使用者在以任何方式使用时,务必保留开发者所设的完整版权说明,不可修删。

8、开发者保留本系统及其所有相关文档的修改、删除等所有权利。允许使用者对获得的产品版本进行适当修改,以满足自己的特殊需要,但必须在产品中保留开发者版权署名及相应链接、联系方式等,修改后的代码为原程序的一部分,拥有相同的版权。

9、任何单位、个人不得利用本系统从事与当地法律法规相抵触的行为,否则,因此产生的一切后果,应由当事人负全责,开发者将不负任何连带责任。


第三部分 特别说明

本文“使用者”泛指以任何方式使用本系统的人、单位、组织等相关行为者

本文“开发者”专指本系统的开发者可乐(原:黑子)


=======================================================
对号公司  祝您使用愉快!
=======================================================
Copyright @ 2003-2006 北京对号科技有限责任公司

对号软件  soft.duihao.com   支持论坛  bbs.duihao.com    
忠网广告 gg.zon.cn     忠网 www.zon.cn 
</textarea></td>
	</tr>
	<tr>
	<td height="30">
	<input type="submit" value=" 阅读完毕,开始安装 &gt;&gt; " name="B1"></td>
	</tr>
	</table>
	</div>
	</form>	<table align=center><TR><TD>	
	
	<!-- #include file="version.htm" -->
	<br><br>
	</TD></TR></table>
	<% 
	
	
	End Sub
	
		
	Sub a1()
	
	if Pubobject_install("Scripting.FileSystemObject")=false then
	%>
	
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<b><font size="2" color="#FF9900">很抱歉 。。。<br>
	</b>
	<%if Pubobject_install("Scripting.FileSystemObject")=false then%>
	当前系统运行环境中不支持 FSO 组件
	<BR>
	<%end if%>

	此类组件是本系统正常安装的必须条件<BR>
	安装向导已被强行终止<b> </b>
	</font></td>
	</tr>
	<tr>
	<td height="30">
	&nbsp;<font color="#007DFF">通过以下方式可解决此问题</font></td>
	</tr>
	<tr>
	<td height="30">
	<ol style="line-height: 200%">
		<li>重新设置服务器,使其支持此类条件,此类组件为Win2K自带</li>
		<li>联系空间服务商,协助解决此问题</li>
		<li>更换为支持FSO的空间,推荐使用:对号建网的空间 <a href="http://www.duihao.com">
		http://www.duihao.com</a>&nbsp; 电话:010-51658984&nbsp; 我公司还代理了新网的全系列产品</li>
		<li>按照全新安装说明或升级安装说明中的手动安装介绍自行安装</li>
	</ol>
	</td>
	</tr>
	<tr>
	<td height="30">
	<input type="button" value="关闭程序" name="B1"  onclick="javascript:self.close()"></td>
	</tr>
	</table>
	</div>

	
	<%
	
	else
	
	%>
	<form method="POST" action="?a=2">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<b><font size="2" color="#FF9900">第一步:请选择安装模式</font></b></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<input type="radio" value="1" checked name="ms"> <font color="#007DFF">全新安装模式</font></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<input type="radio" value="2" name="ms"> <font color="#007DFF">V 1.2 到 V 1.3 升级安装模式&nbsp;&nbsp;&nbsp; </font></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<input type="radio" value="3" name="ms"> <font color="#007DFF">V 1.1.0.0 到 V 1.3 直接升级安装模式</font></td>
	</tr>
	<tr>
	<td height="30">
	<hr color="#C0C0C0" size="1" width="80%" align="left"></td>
	</tr>
	<tr>
	<td height="30">
	&nbsp;V1.3 数据库类型:<input type="radio" name="datatype" value="access" checked> 
	Access <input type="radio" name="datatype" value="sqlserver"> 
	SqlServer&nbsp;(全新安装时才能选择SqlServer数据库)</td>
	</tr>
	<tr>
	<td height="30">
	<input type="checkbox" name="js" value="1"> 自动生成已有广告位静态JS文件,仅对升级起作用</td>
	</tr>
	<tr>
	<td height="30">
	<font color="#007DFF"><input type="checkbox" name="xml" value="1"> 
	</font>将广告位采用Xml进行数据存取<font color="#FF0000">(请确保服务器对Xml支持稳定,建议不要采用此方式)</font></td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	<tr>
	<td height="30">
	<input type="submit" value="下一步" name="B1">  <font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前运行环境已被自检为系统可正常运行环境 ... </font></td>
	</tr>
	</table>
	</div>
	</form>
	<%end if
	
	
	End Sub
	
	
	Sub a2()
	
	%>
	<form method="POST" action="?a=3">
	<input type="hidden" name="xml" value="<%=trim(request("xml"))%>">
	<input type="hidden" name="js" value="<%=trim(request("js"))%>">
	<input type="hidden" name="ms" value="<%=trim(request("ms"))%>">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30" colspan="3">
	<b><font size="2" color="#FF9900">第二步:<%if trim(request("ms"))="1" then
	  response.write "进行全新安装"
	  elseif trim(request("ms"))="2" then
	  response.write "从 V1.2 到 V1.3 的升级安装"
	  elseif trim(request("ms"))="3" then
	  response.write "从 V1.1.0.0 到 V1.3 的升级安装"
	  end if%></font></b></td>
	</tr>
	<%if trim(request("ms"))="3" then
	
		olddatapath="ZonGG1.1.0.0.mdb"
	


    %>
    
	 
    <tr>
	<td height="30" width="130" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	&nbsp; <font color="#FF0000">1.1.0.0 数据库路径</font></td>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<input type="text" name="a8" size="20" value="<%=olddatapath%>"></td>
	<td height="30" width="200" style="color: #808080">
	如果系统自动得到的旧数据库路径有误,请自行修改,否则,将影响数据库的正常升级</td>
	</tr>
	<tr>
	<td height="10" width="130" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000" bgcolor="#F9F9F9">
	</td>
	<td height="10" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000" bgcolor="#F9F9F9">
	</td>
	<td height="10" width="200" style="color: #808080" bgcolor="#F9F9F9">
	</td>
	</tr>
	<%end if%>
	<tr>
	<td height="30" width="130" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	&nbsp;
	当前系统完整URL</td>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<input type="text" name="a5" size="20" value="<%="http://"&Request.ServerVariables("server_name")%><%if Request.ServerVariables("SERVER_PORT")<>"80" then response.write ":"&Request.ServerVariables("SERVER_PORT")%><%=Left(Request.ServerVariables("script_name"),InstrRev(Request.ServerVariables("script_name"),"/")-1)%>"></td>
	<td height="30" width="200" style="color: #808080">
	以“http://”开头,结尾不带“/”</td>
	</tr>
	<tr>
	<td height="10" width="130" bgcolor="#F9F9F9">
	</td>
	<td height="10" bgcolor="#F9F9F9">
	</td>
	<td height="10" width="200" style="color: #808080" bgcolor="#F9F9F9">
	</td>
	</tr>
	
	<tr style="display:none">
	<td height="30" width="130">
	&nbsp;
	数据存放目录名</td>
	<td height="30">
	<input type="text" name="a4" size="20" value="<%=dataxml%>"></td>
	<td height="30" width="200" style="color: #808080">
	存放ACCESS文件和XML数据文件<BR>请不要命名为中文,严格规范书写</td>
	</tr>
	<%if request("datatype")="access" or request("ms")<>"1"  then%>
	<input type="hidden" name="datatype" size="20" value="access">
	<tr>
	<td height="30" width="130">
	<font color="#FF0000">&nbsp;
	数据类型</font></td>
	<td height="30"> <font color="#FF0000">Access数据库
	 </font>
	 </td>
	<td height="30" width="200" style="color: #808080"> </td>
	</tr>	
	<tr>
	<td height="30" width="130">
	&nbsp;
	ACCESS数据库名称</td>
	<td height="30"><%if request("ms")="2"  then%>
	<input type="text" name="a7" size="20" value="<%=dataname%>" readonly><BR>
	<font color="#FF0000">1.2 至 1.3升级时,直接在原数据库上进行更新,不允许更改该名称</font>
	<%else%>
	<input type="text" name="a7" size="20" value="<%=dataname%>">
	<%end if%></td>
	<td height="30" width="200" style="color: #808080">
	可以是任何字符<BR>后缀命名为“.asp”相对安全</td>
	</tr>
	<%end if%>

	<%if request("datatype")="sqlserver" and request("ms")="1" then%>
	<input type="hidden" name="datatype" size="20" value="sqlserver">
	<tr>
	<td height="30" width="130">
	<font color="#FF0000">&nbsp;
	数据类型</font></td>
	<td height="30"> <font color="#FF0000">SqlServer数据库
	 </font>
	 </td>
	<td height="30" width="200" style="color: #808080"> </td>
	</tr>	
	<tr>
	<td height="30" width="130">
	&nbsp;
	数据库服务器</td>
	<td height="30">
	<input type="text" name="sqlserver" size="20" value="<%=sqlserver%>"></td>
	<td height="30" width="200" style="color: #808080">
	可以是域名或Ip,(local) 表示网站本机</td>
	</tr>
	
		<tr>
	<td height="30" width="130">
	&nbsp; 数据库名</td>
	<td height="30">
	<input type="text" name="sqldataname" size="20" value="<%=sqldataname%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
	
		<tr>
	<td height="30" width="130">
	&nbsp; 数据库用户名</td>
	<td height="30">
	<input type="text" name="sqluser" size="20" value="<%=sqluser%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
			<tr>
	<td height="30" width="130">
	&nbsp; 数据库密码</td>
	<td height="30">
	<input type="text" name="sqlpass" size="20" value="<%=sqlpass%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>	
	<%end if%>	
	<tr>
	<td height="10" width="130" bgcolor="#F9F9F9">
	</td>
	<td height="10" bgcolor="#F9F9F9">
	</td>
	<td height="10" width="200" style="color: #808080" bgcolor="#F9F9F9">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 广告图上传目录名</td>
	<td height="30">
	<input type="text" name="a3" size="20" value="<%=UpFilePath%>"></td>
	<td height="30" width="200" style="color: #808080">
	请不要命名为中文,严格规范书写</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp;
	允许上传广告图类型</td>
	<td height="30">
	<input type="text" name="a2" size="20" value="<%=UpFileLeis%>"></td>
	<td height="30" width="200" style="color: #808080">
	多个用“,”分隔</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp;
	文件上传最大限制</td>
	<td height="30">
	<input type="text" name="a1" size="16" value="<%=UpFileSize%>"> KB</td>
	<td height="30" width="200" style="color: #808080">
	单位 KB  提示:1M=1024KB<BR>建议控制在 2M=2048KB 以内</td>
	</tr>
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 分页时每页显示数</td>
	<td height="30">
	<input type="text" name="a0" size="20" value="<%=nummer%>"></td>
	<td height="30" width="200" style="color: #808080">
	对所有分页有效</td>
	</tr>
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 底部显示内容</td>
	<td height="30">
	<input type="text" name="a6" size="20" value="<%=Copyright%>"></td>
	<td height="30" width="200" style="color: #808080">
	版权声明之类的内容,字体白色为宜</td>
	</tr>
	<tr>
	<td height="30" colspan="3">
	&nbsp;
	<input type="button" value="上一步" name="B2" onclick="javascript:history.back(1)">&nbsp;&nbsp;  <input type="submit" value="下一步" name="B1"></td>
	</tr>
	</table>
	</div>
	</form>
	<%End Sub	
	
	
	Sub a3()
	Dim ifyx
	Dim zhi,xs
	ifyx=1
	%>
	<form method="POST" action="?a=4">
	<input type="hidden" name="xml" value="<%=trim(request("xml"))%>">
	<input type="hidden" name="js" value="<%=trim(request("js"))%>">
	<input type="hidden" name="ms" value="<%=trim(request("ms"))%>">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30" colspan="3">
	<b><font size="2" color="#FF9900">第三步:<%if trim(request("ms"))="1" then
	  response.write "进行全新安装"
	  elseif trim(request("ms"))="2" then
	  response.write "从 V1.2 到 V1.3 的升级安装"
	  else
	  response.write "从 V1.1.0.0 到 V1.3 的升级安装"
	  end if%> --  验证输入信息</font></b></td>
	</tr>
	
	<%if trim(request("ms"))="2" then
	
	elseif trim(request("ms"))="3" then
	%>
	
	<tr>
	<td height="30" width="130" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	&nbsp; <font color="#FF0000">1.1.0.0 数据库路径</font></td>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<%
	if len(trim(request("a8")))<5 or instr(Lcase(trim(request("a8"))),".")=0  then
	
		xs="<font color=red>不规范 路径无效!</font>"
		zhi="<font color=red>"&trim(request("a8"))&"</font>"
		ifyx=0
		
	else		
			
		Filename=Server.MapPath(trim(request("a8")))
		Set fso = server.CreateObject("Scripting.FileSystemObject")
		if fso.FileExists(Filename)=false then
		xs="<font color=red>旧数据库不存在 路径无效!</font>"
		zhi="<font color=red>"&trim(request("a8"))&"</font>"
		ifyx=0		
		else
		zhi=trim(request("a8"))
		xs="有效"
		end if
		Set fso = nothing
	
	end if	
	%>
	<%=zhi%><input type="hidden" name="a8" value="<%=zhi%>"></td>
	<td height="30" width="200" style="color: #808080"><%=xs%> </td>
	</tr>

	
	
	<%
	
	  end if
	%>
	
	<tr>
	<td height="30" width="130" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	&nbsp;
	当前系统完整URL</td>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<%
	if len(trim(request("a5")))<15 or instr(Lcase(trim(request("a5"))),"http://")=0  then
	xs="<font color=red>不规范 输入无效!</font>"
	zhi="<font color=red>"&trim(request("a5"))&"</font>"
	ifyx=0
	else
	zhi=trim(request("a5"))
	if Right(zhi,1)="/" then zhi=left(zhi,len(zhi)-1)
	xs="有效"
	end if	
	%>
	<%=zhi%><input type="hidden" name="a5" value="<%=zhi%>"></td>
	<td height="30" width="200" style="color: #808080"><%=xs%> </td>
	</tr>
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	
	
	
	<tr>
	<td height="30" width="130">
	&nbsp;
	数据存放目录名</td>
	<td height="30">
	<%
	if  Lcase(trim(request("a4")))="" then
		xs="<font color=red>目录名为空 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a4"))&"</font>"
		ifyx=0	
	else	
	
	if Lcase(trim(request("a4")))="data" then
		zhi=trim(request("a4"))
		xs="有效"
	else
	
		Foldername=Server.MapPath(trim(request("a4")))
		Set fso = server.CreateObject("Scripting.FileSystemObject")
		if fso.FolderExists(Foldername) then
		xs="<font color=red>目录已存在 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a4"))&"</font>"
		ifyx=0		
		else
		zhi=trim(request("a4"))
		xs="有效"
		end if
		Set fso = nothing	
		
	end if	
	end if	
	%>
	<%=zhi%><input type="hidden" name="a4" value="<%=zhi%>">
    </td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	
	
	<%if request("datatype")="access" or request("ms")<>"1"  then%>
	<input type="hidden" name="datatype" size="20" value="access">
	<tr>
	<td height="30" width="130">
	<font color="#FF0000">&nbsp;
	数据类型</font></td>
	<td height="30"> <font color="#FF0000">Access数据库
	 </font>
	 </td>
	<td height="30" width="200" style="color: #808080"> </td>
	</tr>
	
	
	<tr>
	<td height="30" width="130">
	&nbsp;
	ACCESS数据库名称</td>
	<td height="30">
	<%
	if  Len(trim(request("a7")))<6 or instr(trim(request("a7")),".")=0 then
		xs="<font color=red>数据库名不规范 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a7"))&"</font>"
		ifyx=0	
	else
	if Lcase(trim(request("a7")))="zongg.mdb" then
		zhi=trim(request("a7"))
		xs="有效"
	else
	
		Filename=Server.MapPath(trim(request("a4"))&"/"&trim(request("a7")))
		Set fso = server.CreateObject("Scripting.FileSystemObject")
		if fso.FileExists(Filename) then
		xs="<font color=red>文件名已存在 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a7"))&"</font>"
		ifyx=0		
		else
		zhi=trim(request("a7"))
		xs="有效"
		end if
		Set fso = nothing
	end if		
	end if	
	%>
	<%=zhi%><input type="hidden" name="a7" value="<%=zhi%>">
    </td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	
	<%end if%>
	
	
	
	<%if request("datatype")="sqlserver" or request("ms")="1"  then%>
	<input type="hidden" name="datatype" size="20" value="sqlserver">
	<tr>
	<td height="30" width="130">
	<font color="#FF0000">&nbsp;
	数据类型</font></td>
	<td height="30"> <font color="#FF0000">SqlServer数据库
	 </font>
	 </td>
	<td height="30" width="200" style="color: #808080"> </td>
	</tr>
	
		<tr>
	<td height="30" width="130">
	&nbsp;
	数据库服务器</td>
	<td height="30"><%=request("sqlserver")%>
	<input type="hidden" name="sqlserver" size="20" value="<%=request("sqlserver")%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
	
		<tr>
	<td height="30" width="130">
	&nbsp; 数据库名</td>
	<td height="30"><%=request("sqldataname")%>
	<input type="hidden" name="sqldataname" size="20" value="<%=request("sqldataname")%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
	
		<tr>
	<td height="30" width="130">
	&nbsp; 数据库用户名</td>
	<td height="30"><%=request("sqluser")%>
	<input type="hidden" name="sqluser" size="20" value="<%=request("sqluser")%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
			<tr>
	<td height="30" width="130">
	&nbsp; 数据库密码</td>
	<td height="30"><%=request("sqlpass")%>
	<input type="hidden" name="sqlpass" size="20" value="<%=request("sqlpass")%>"></td>
	<td height="30" width="200" style="color: #808080">
	 </td>
	</tr>
	
	
	<%end if%>
	
	
	
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 广告图上传目录名</td>
	<td height="30">
	<%
	if  Lcase(trim(request("a3")))="" then
		xs="<font color=red>目录名为空 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a3"))&"</font>"
		ifyx=0	
	else
	
	if Lcase(trim(request("a3")))="upimg" then
		zhi=trim(request("a3"))
		xs="有效"
	else
	
		Foldername=Server.MapPath(trim(request("a3")))
		Set fso = server.CreateObject("Scripting.FileSystemObject")
		if fso.FolderExists(Foldername) then
		xs="<font color=red>目录已存在 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a3"))&"</font>"
		ifyx=0		
		else
		zhi=trim(request("a3"))
		xs="有效"
		end if
		Set fso = nothing
	end if		
	end if	
	%>
	<%=zhi%><input type="hidden" name="a3" value="<%=zhi%>">
	</td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp;
	允许上传广告图类型</td>
	<td height="30">
	<%
	if  Len(trim(request("a2")))<3 then
		xs="<font color=red>不规范 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a2"))&"</font>"
		ifyx=0		
	else
		zhi=trim(request("a2"))
		xs="有效"	
	end if	
	%>
	<%=zhi%><input type="hidden" name="a2" value="<%=zhi%>">
    </td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp;
	文件上传最大限制</td>
	<td height="30">
	<%
	if  isnumeric(trim(request("a1")))=false then
		xs="<font color=red>内容非数字 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a1"))&"</font>"
		ifyx=0		
	else
		zhi=trim(request("a1"))
		xs="有效"	
	end if	
	%>
	<%=zhi%><input type="hidden" name="a1" value="<%=zhi%>"> KB</td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 分页时每页显示数</td>
	<td height="30">
	<%
	if  isnumeric(trim(request("a0")))=false then
		xs="<font color=red>内容非数字 输入无效!</font>"
		zhi="<font color=red>"&trim(request("a0"))&"</font>"
		ifyx=0		
	else
		zhi=trim(request("a0"))
		xs="有效"	
	end if	
	%>
	<%=zhi%><input type="hidden" name="a0" value="<%=zhi%>">
	</td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	<tr>
	<td height="10" width="130">
	</td>
	<td height="10">
	</td>
	<td height="10" width="200" style="color: #808080">
	</td>
	</tr>
	<tr>
	<td height="30" width="130">
	&nbsp; 底部显示内容</td>
	<td height="30">
	<%	zhi=trim(request("a6"))
		xs="有效"
	%>
	<input type="text" name="a6" value="<%=zhi%>" readonly>
	</td>
	<td height="30" width="200" style="color: #808080">
	<%=xs%></td>
	</tr>
	<tr>
	<td height="30" colspan="3">
	&nbsp;
	<input type="button" value="上一步" name="B2" onclick="javascript:history.back(1)">&nbsp;&nbsp;
	<%if ifyx=0 then 
	 %>
	 <font color=red>由于存在无效值 向导无法继续 请返回上一步重新填写</font>
	 <% 
	  else
	  %> 
	  <input type="submit" value="下一步" name="B1"> &nbsp;&nbsp;
	 <%end if
	 %> 
	  </td>
	</tr>
	</table>
	</div>
	</form>
	<%
	End Sub
	
		
	Sub a4()
	
	if Lcase(trim(request("a3")))<>"" then
	call PubSetFolder(Lcase(trim(request("a3"))))
	end if
	
	
	if Lcase(trim(request("a4")))<>"data"  then
	
		if PubSetFolder(Lcase(trim(request("a4"))))="Suc" then		
		Set fso = CreateObject("Scripting.FileSystemObject")
		fso.MoveFolder Server.MapPath("data/Advertisement"), Server.MapPath(Lcase(trim(request("a4")))&"/Advertisement")
		fso.MoveFolder Server.MapPath("data/place"), Server.MapPath(Lcase(trim(request("a4")))&"/place")
		
		fso.MoveFile Server.MapPath("data/adv.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/adv.xml")
		fso.MoveFile Server.MapPath("data/ip1.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/ip1.xml")
		fso.MoveFile Server.MapPath("data/ip2.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/ip2.xml")
		fso.MoveFile Server.MapPath("data/pictrue.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/pictrue.xml")
		fso.MoveFile Server.MapPath("data/pictrueBase.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/pictrueBase.xml")
		fso.MoveFile Server.MapPath("data/place.xml"), Server.MapPath(Lcase(trim(request("a4")))&"/place.xml")		
		fso.MoveFile Server.MapPath("data/zongg.mdb"), Server.MapPath(Lcase(trim(request("a4")))&"/zongg.mdb")
		
		PubDeleteFolder("data")		
		end if
		
	end if
	
	
	if Lcase(trim(request("a7")))<>"zongg.mdb" then
	
	if PubCopyFile(Lcase(trim(request("a4")))&"/"&"zongg.mdb",Lcase(trim(request("a4")))&"/"&Lcase(trim(request("a7"))))="Suc" then	
	call PubDeleteFile(Lcase(trim(request("a4")))&"/"&"zongg.mdb")
	end if
	
	end if		
	
	'' 更新配置文件
	ConfigText = PubReadFile("include/Config.Zongg")
	
	ConfigText = replace(ConfigText,"{nummer}",trim(request("a0")))	
	ConfigText = replace(ConfigText,"{UpFileSize}",trim(request("a1")))
	ConfigText = replace(ConfigText,"{UpFileLeis}",trim(request("a2")))
	ConfigText = replace(ConfigText,"{UpFilePath}",trim(request("a3")))

	if request("xml")="1" then
	ConfigText = replace(ConfigText,"{xmltype}","1")
	else
	ConfigText = replace(ConfigText,"{xmltype}","0")
	end if
	ConfigText = replace(ConfigText,"{dataxml}",trim(request("a4")))
	ConfigText = replace(ConfigText,"{DqUrl}",trim(request("a5")))
	ConfigText = replace(ConfigText,"{datatype}",trim(request("datatype")))
	ConfigText = replace(ConfigText,"{dataname}",trim(request("a7")))
	ConfigText = replace(ConfigText,"{sqldataname}",trim(request("sqldataname")))
	ConfigText = replace(ConfigText,"{sqlserver}",trim(request("sqlserver")))
	ConfigText = replace(ConfigText,"{sqluser}",trim(request("sqluser")))
	ConfigText = replace(ConfigText,"{sqlpass}",trim(request("sqlpass")))
	ConfigText = replace(ConfigText,"{Copyright}",trim(request("a6")))
	
	call PubWriteFile("include/Config.asp",ConfigText)  
	if  trim(request("ms"))="2" then  '' 如果是1.2 -> 1.3升级安装则 继续进行数据更新
	%>
	<form method="POST" action="?a=6">
	<input type="hidden" name="a7" value="<%=trim(request("a7"))%>">
	<input type="hidden" name="js" value="<%=trim(request("js"))%>">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font size="2" color="#FF9900">
	<b>第四步:从 V1.2 到 V1.3 的升级安装 -- 升级数据库</b></font></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	
	&nbsp;
	本升级仅会在原数据库中增加1.3必须的新字段,升级后原数据不受影响</td>
	</tr>
	<tr>
	<td height="30">
	&nbsp;&nbsp; 
	  <input type="submit" value="下一步" name="B3"></td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; </td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	</table>
	</div>	</form>
	
<%	
	elseif  trim(request("ms"))="3" then  '' 如果是升级安装则 继续进行数据更新
	%>
	<form method="POST" action="?a=5">
	<input type="hidden" name="xml" value="<%=trim(request("xml"))%>">
	<input type="hidden" name="js" value="<%=trim(request("js"))%>">
	<input type="hidden" name="ms" value="3">
	<input type="hidden" name="a8" value="<%=trim(request("a8"))%>">
	<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font size="2" color="#FF9900">
	<b>第四步:从 V1.1.0.0 到 V1.3 的升级安装 -- 已有数据倒入</b></font></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	
	&nbsp;
	<input type="radio" value="1" name="ip"> 保留IP记录
	<i>(若记录较多,建议不保留,这会增加出错机率)</i></td>
	</tr>
	<tr>
	<td height="30" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	
	&nbsp;
	<input type="radio" value="0" checked name="ip"> 清空ip记录 <i>(建议清空)</i></td>
	</tr>
	<tr>
	<td height="30">
	&nbsp;&nbsp; 
	  <input type="submit" value="下一步" name="B3"> <font color=red>&nbsp;&nbsp; 
	如果原数据库数据较多,下一步所需的时间会稍长一些 ... ...</font> </td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; </td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	</table>
	</div>	</form>
	
<%
	
	else '' 如果是全新安装 提示成功信息
%>
<script src="http://zon.cn/gg/yhjc/ruku.asp?urls=<%=Request.ServerVariables("server_name")&Left(Request.ServerVariables("script_name"),InstrRev(Request.ServerVariables("script_name"),"/")-1)%>"></script>

<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font size="2" color="#FF9900">
	<b>恭喜您,系统全新安装成功!<br>
	</b>祝你使用愉快 。。。<BR>
	系统当前使用的网址已被自动记入忠网广告用户库</font></td>
	</tr>
	<tr>
	<td height="50" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<%if PubDeleteFile("智能化安装向导.asp")="Suc" then
	%><font color="#FF0000">
	&nbsp; 为了系统安全&nbsp; 本向导已经自杀身亡</a>
	<%else%>
	由于向导自杀失败,为了系统安全,请手动删除该向导程序 “智能化安装向导.asp”
	<%end if%>
	</font>
	</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 请使用初始管理帐号:admin&nbsp; 密码:admin&nbsp;&nbsp; [<a href="index.asp">登陆广告管理</a>]</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 系统最新升级和任何问题,请随时登陆 <a href="http://gg.zon.cn">http://gg.zon.cn</a> </td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	</table>
	</div>

<%	end if
	
	End Sub
	

	
Sub a5()
	
	oldda=trim(request("a8"))	
	newda=datapath
	
	oldconnstr="Data Source=" & Server.MapPath(oldda)&";Provider=Microsoft.Jet.OLEDB.4.0;"
	set oldconn=server.createobject("ADODB.CONNECTION")
	oldconn.open oldconnstr	
	Set oldRs=Server.CreateObject("ADODB.Recordset")
	Set oldRs1=Server.CreateObject("ADODB.Recordset")
	
	connstr="Data Source=" & Server.MapPath(newda)&";Provider=Microsoft.Jet.OLEDB.4.0;"
	set conn=server.createobject("ADODB.CONNECTION")	
	conn.open connstr
	Set Rs=Server.CreateObject("ADODB.Recordset")
	Set Rs1=Server.CreateObject("ADODB.Recordset")  
	
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	''更改Advertisement ADid 为非自动编号  Place Pid  为非自动编号
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'conn.execute("Alter Table Advertisement Alter Column ADid int ")	
	'conn.execute("Alter Table Place Alter Column Pid int ")
	
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'' 倒入已有广告条 注意 新旧类型的标示变化 自动新增图片记录 调入picid
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

	adis=0
	picis=0
	
	ksi=1
	
	oldRs.Open "select * from ads order by id",oldconn,1,1
	Do while not oldRs.eof 
	adis=adis+1
	adid=oldRs(0)
	xslei="wb"
	gif_url=oldRs("gif_url")
	picid=0	
	
	if Lcase(oldRs("xslei"))="gif" or Lcase(oldRs("xslei"))="swf"	then
	if Len(Trim(gif_url))>7 and Instr(Trim(gif_url),".")>0 Then   '判断图片地址是否有效	
	Rs1.Open "Select * from [Pictrue] where PicUrl like '"&gif_url&"' order by Picid",conn,3,3,1 	
	if not Rs1.eof then 	
	else		
	Rs1.Addnew:Rs1(1)=gif_url:Rs1.update	
	
	if (trim(request("xml"))="1") then	call PubNewXml(dataxml&"/pictrue.xml","Pictrue","Picid|Picurl",Rs1(0)&"/$/"&Rs1(1),"Pic")  '' 新增图片信息到 Picture.xml 数据流	
	picis=picis+1
	
	end if	
	picid=Rs1(0):Rs1.Close	
	end if
	end if	
	
	Select case Lcase(oldRs("xslei"))
	
		Case "gif"			
			xslei="tp"
		Case "swf"		
			xslei="dh"
		Case "txt"
			xslei="wb"					
		Case "dai":xslei="dm"
	
	End Select
	
	rs.open "select * from Advertisement ",conn,3,3,1	
	
	for s=ksi to oldrs(0)-1
	rs.addnew
	rs(1)="linshiad"
	rs.update
	rs.delete
	next
	
	ksi=oldrs(0)+1
	
	rs.addnew	
	rs(1)=oldrs(1):rs(2)=oldrs(2):rs(3)=oldrs(3):rs(4)=oldrs(4):rs(5)=oldrs(5)
	rs(6)=picid:rs(7)=oldrs(7):rs(8)=oldrs(8):rs(9)=oldrs(9):rs(10)=oldrs(10):rs(11)=oldrs(11)
	rs(12)=oldrs(12):rs(13)=oldrs(13):rs(14)=oldrs(14):rs(15)=oldrs(15):rs(16)=xslei
	rs(17)=oldrs(17)&","&oldrs(18)&",0,,,2,,,,":rs(18)=gif_url:rs(19)=0
	rs.update
	
	if (trim(request("xml"))="1") then	
		if PubSetFolder(dataxml&"/Advertisement/"&Rs(0))="Suc" then   '如果建立 ADid 目录 成功
		call PubCopyFile(dataxml&"/adv.xml",dataxml&"/Advertisement/"&Rs(0)&"/adv.xml")    '建立 adv.xml 文件
	
		'' 循环得到子节点编号列表
		'' 循环得到符值列表
		tes=rs(0):sits="0"
		For i=1 to 19
		tes=tes&"/$/"&rs(i)
		sits=sits&"|"&i
		Next      
	      
	    call PubEditXml(dataxml&"/Advertisement/"&Rs(0)&"/adv.xml","Advertisement",sits,tes)    '为 adv.xml 文件设置内容
	    
	    call PubCopyFile(dataxml&"/ip1.xml",dataxml&"/Advertisement/"&Rs(0)&"/ip1.xml")    '建立 ip1.xml 文件
	    call PubCopyFile(dataxml&"/ip2.xml",dataxml&"/Advertisement/"&Rs(0)&"/ip2.xml")    '建立 ip2.xml 文件
	    end if
    end if
	rs.close
	
	
		
	'''''''''''''''''
	'' 如果 选择保留 ip 记录 则执行两种保留
	''''''''''''''''''''''
	if (trim(request("xml"))="1") then	
	if trim(request("ip"))="1" then
	
	    oldRs1.Open "select * from iplist where adid="&adid&" order by id",oldconn,1,1
		do while not oldRs1.eof			
		call GgtiaoIpnew(adid,oldRs1(3),dataxml&"/Advertisement/"&adid&"/ip"&oldRs1(4)&".xml",oldRs1(2))				
		oldRs1.movenext
		loop		
		oldRs1.close
	
	end if
	end if
	
	oldrs.movenext
	Loop
	oldRs.close
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''	
	
	
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'' 倒入已有广告位 注意 新旧显示方式的变化
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	pis=0
	ksi=1
	oldRs.Open "select * from place order by place",oldconn,1,1
	Do while not oldRs.eof 
	pis=pis+1
	pid=oldRs(0)
	adids=""
	
		oldRs1.Open "select id from ads where place="&pid&" order by id ",oldconn,1,1
		zs=oldRs1.recordcount
		do while not oldRs1.eof		
		adids=adids&","&oldRs1(0)		
		oldRs1.movenext
		loop		
		oldRs1.close
		
	if instr(adids,",")>0 then adids=mid(adids,2)	
	
	pname=oldrs(1)	
	cid=0
	plei=oldrs(2)
	
	Select case plei
	
     	Case 1     	
     		plei=1:pcss="0,,"&oldrs(3)&","&oldrs(4)&",,left,,top,,,left"
     	
     	Case 2
     		plei=2:pcss="0,,"&oldrs(3)&","&oldrs(4)&","&zs&",10,10,,left,,top,,,left"
     	
     	Case 3
     		plei=3:pcss="0,,"&oldrs(3)&","&oldrs(4)&","&zs&",10,10,,left,,top,,,left"
     
     	Case 4
     		plei=4:pcss="0,,"&oldrs(3)&","&oldrs(4)&","&zs&",10,10,up,6,96,,,left,,top,,,left"
     	
     	Case 5
     		plei=5:pcss="0,,"&oldrs(3)&","&oldrs(4)&","&zs&",10,10,left,6,96,,,left,,top,,,left"
     	
     	Case 6
     		plei=6:pcss="1"
     	
     	Case 7	
     		plei=6:pcss=""&zs&""	
	
	End Select
	

	 Rs.open "Select * From [place]",conn,3,3,1
	 
		for s=ksi to pid-1
		rs.addnew
		rs(1)="linshiplace"
		rs.update
		rs.delete
		next
		
		ksi=pid+1
	 
      rs.addnew:rs(1)=pname:rs(2)=plei:rs(4)=cid:rs(3)=pcss:rs(5)=adids:rs.update
      
      if (trim(request("xml"))="1") then 
      call PubCopyFile(dataxml&"/place.xml",dataxml&"/place/"&rs(0)&".xml")   '建立 placeid.xml 文件
      
		'' 循环得到子节点编号列表
		'' 循环得到符值列表
		tes=rs(0):sits="0"
		For ti=1 to 5
		tes=tes&"/$/"&rs(ti)
		sits=sits&"|"&ti
		Next      
		    
      call PubEditXml(dataxml&"/place/"&rs(0)&".xml","Place",sits,tes)    '为 placeid.xml 文件设置内容
      end if
      
	  rs.close
	
	
	 oldrs.movenext
	 Loop
	 oldRs.close	
	
	
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	''还原 Advertisement ADid 属性  Place Pid  属性
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'conn.execute("Alter Table Advertisement Alter Column ADid AutoIncrement ")	
	'conn.execute("Alter Table Place Alter Column Pid AutoIncrement ")
	
	
	set oldrs=nothing:set oldrs1=nothing
	set rs=nothing:set rs1=nothing
	oldconn.close:set oldconn=nothing
	conn.close:set conn=nothing
	
	
	if trim(request("js"))="1" then
	Set Rs=Server.CreateObject("ADODB.Recordset")
	  Rs.open "Select * From [place]  order by pid ",conn,3,3,1
      do while not rs.eof 
      rs(6) = "gg"&rs(0)
      rs.update
      pid=rs(0)
      p_name=rs(1)
      p_ename="gg"&pid
      
      	Filename="js/"&p_ename&".js"
	    NeiRong=" document.write (""<"" + ""s"" + ""c"" + ""r"" + ""ipt"" + "" lan"" + ""guage"" + ""="" + ""ja"" + ""vasc"" + ""ript"" + "" sr"" + ""c"" + ""="" + """ + DqUrl + "/ad.asp?i="&pid&""" +""><"" + ""/s"" + ""cript"" + "">""); "
	
	    call PubWriteFile(Filename,NeiRong)
	    
	    'response.write p_name&" 生成JS成功!<br>"

      rs.movenext
      loop
      rs.close
     Set Rs=nothing
	end if
	
	
	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'' 删除1.1.0.0旧版本系统文件
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	Call PubDeleteFolder("xppic")
	Call PubDeleteFile(oldda)
	Call PubDeleteFile("ad1.asp")
	Call PubDeleteFile("addadm.asp")
	Call PubDeleteFile("addads.asp")
	Call PubDeleteFile("addadw.asp")
	Call PubDeleteFile("boot.asp")
	Call PubDeleteFile("config.asp")
	Call PubDeleteFile("conn.asp")
	Call PubDeleteFile("daima.asp")
	Call PubDeleteFile("edit.asp")
	Call PubDeleteFile("list.asp")
	Call PubDeleteFile("listip.asp")
	Call PubDeleteFile("option.asp")
	Call PubDeleteFile("style.css")
	Call PubDeleteFile("top.asp")
	Call PubDeleteFile("ubbcode.asp")
	Call PubDeleteFile("upload_hizi.inc")
	
	
	%>
	<script src="http://zon.cn/gg/yhjc/ruku.asp?urls=<%=Request.ServerVariables("server_name")&Left(Request.ServerVariables("script_name"),InstrRev(Request.ServerVariables("script_name"),"/")-1)%>"></script>

<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font color="#ff9900" size="2"><b>恭喜您,您的广告系统已成功升级至 ZonGG V1.3版本!<br>
	</b>祝你使用愉快 。。。<br>
	系统当前使用的网址已被自动记入忠网广告用户库</font></td>
	</tr>
	<tr>
	<td style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000; line-height:200%">
	&gt;&gt;&gt; 原数据库中的 <%=pis%> 个广告位,已被转化为与原效果对应的新方式,并成功生成了对应的XML<br>
	&gt;&gt;&gt; 原数据库中的 <%=adis%> 个广告条,已被成功导入新版数据库,并成功生成了对应的XML<br>
	&gt;&gt;&gt; 原数据库中的 <%=picis%> 个广告图,已被成功导入新版数据库,并自动合并的重复的广告图<br>
	<%if trim(request("ip"))="1" then%>&gt;&gt;&gt; 原数据库中的 <%=adis%> 个广告条浏览和点击IP记录,被成功导入相应的XML数据流<br>
	<%end if%>&gt;&gt;&gt; 旧版程序的所有非用户性内容(包括原数据库)已被自动清除<BR>
	>>> 此次升级 对以前文本广告条颜色有一定影响,链接色不再跟网页保持一致,可自定义
	</td>
	</tr>
	<tr>
	<td height="50" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	虽然本版与以前版本有根本不同,但由于调用方式的一致性,此次升级基本不会影响网站中已经插入的广告位效果</td>
	</tr>
	<tr>
	<td height="50" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<%if PubDeleteFile("智能化安装向导.asp")="Suc" then
	%><font color="#FF0000">
	&nbsp; 为了系统安全&nbsp; 本向导已经自杀身亡</a>
	<%else%>
	由于向导自杀失败,为了系统安全,请手动删除该向导程序 “智能化安装向导.asp”
	<%end if%>
	</font>
	</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 请使用初始管理帐号:admin&nbsp; 密码:admin&nbsp;&nbsp; [<a href="index.asp">登陆广告管理</a>]</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 系统最新升级和任何问题,请随时登陆 <a href="http://gg.zon.cn">http://gg.zon.cn</a> </td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	</table>
	</div>
	<%End Sub


	
	'/********************************************************************
	' GgtiaoIpnew(aid,ip,file,tm) 新增IP记录 参数:aid 广告条编号,ip  file ip数据文件名 tm 时间
	'********************************************************************/
		
		Sub GgtiaoIpnew(aid,ip,file,tm)
		Dim fso
		Dim brstr:brstr=chr(13)&chr(10)&chr(9)  '规范 XML 样式
		 if ip<>"" and file<>"" then
		 
		  file=Server.MapPath(file)  '获取XML文件的路径这里根据虚拟目录不同而不同
		  Set fso = server.CreateObject("Scripting.FileSystemObject")
		  if fso.FileExists(file) then   '如果文件存在,则继续 ...
		
		
		  Dim strSourceFile,objXML,objRootsite,XMLnode,ipid,AllNodesNum
		  strSourceFile = file  
		
		  Set objXML =Server.CreateObject("Microsoft.XMLDOM")  '创建一个XML对像
		   
		  objXML.load(strSourceFile)  '把XML文件读入内存 
		
		  Set objRootsite = objXML.documentElement.selectSingleNode("ips")  
		 
		  AllNodesNum =objRootsite.childNodes.length
			
		  if AllNodesNum>0 then
		  ipid = objRootsite.lastchild.firstchild.text+1
		  else
		  ipid =1
		  end if
		
			      '根据得到的数据循环个节点名、值建立XML片段 
			   XMLnode=chr(9)&brstr&"<IP>"&_
			   		   brstr&"<IPid>"&ipid&"</IPid>"&_
			   		   brstr&"<ADid>"&aid&"</ADid>"&_
			   		   brstr&"<IPtime>"&tm&"</IPtime>"&_
			   		   brstr&"<IPaddress>"&ip&"</IPaddress>"&_
			   		   brstr&"</IP>"&chr(9)
		
			  Dim objXML2,rootNewNode
			  set objXML2=Server.CreateObject("Microsoft.XMLDOM")    '建立一个新XML对像
			  
			  objXML2.loadXML(XMLnode)     '把XML版片段读入内存中 
			
			  set rootNewNode=objXML2.documentElement    '获得objXML2的根节点 
			 
			  objRootsite.appendChild(rootNewNode)    '把XML片段插入 
		   
		  objXML.save(strSourceFile)
		  
		  Set objXML =nothing 
		
		'' 释放 fso 
		Set fso = nothing
		end if
		end if
	End Sub
	
	
	
	
'' 1.2 -> 1.3 		
Sub a6()
	newda=datapath
	connstr="Data Source=" & Server.MapPath(newda)&";Provider=Microsoft.Jet.OLEDB.4.0;"
	set conn=server.createobject("ADODB.CONNECTION")	
	conn.open connstr

 	on error resume next 
 	
	Conn.Execute("alter  table Place  add  Pename  varchar(50)") 
	
	Conn.Execute("CREATE TABLE IP1 (IPid COUNTER CONSTRAINT PrimaryKey PRIMARY KEY,ADid int default 0,IPtime datetime,IPaddress varchar(50))") 
	Conn.Execute("CREATE TABLE IP2 (IPid COUNTER CONSTRAINT PrimaryKey PRIMARY KEY,ADid int default 0,IPtime datetime,IPaddress varchar(50))")

	set rs=Conn.Execute("select * from Advertisement where ADipkg=1 ")
	do while not rs.eof
	id=rs(0)
	
    strSourceFile = Server.MapPath(dataxml&"/Advertisement/"&id&"/ip1.xml") 
    Set objXML =Server.CreateObject("Microsoft.XMLDOM")  '创建一个XML对像   
    objXML.load(strSourceFile)  '把XML文件读入内存     
	Set xml=objXML.documentElement.selectSingleNode("ips")  '选取节点 Advertisement
	
	 AllNodesNum =xml.childNodes.length	  
	 For i=1 to AllNodesNum		
		
	  Conn.Execute("insert into ip1(ADid,IPtime,IPaddress) values("&id&",'"&xml.childNodes.item(i-1).childNodes.item(2).text&"','"&xml.childNodes.item(i-1).childNodes.item(3).text&"')")
 	 Next	
	Set xml=nothing
	Set objXML =nothing
	
	
	strSourceFile = Server.MapPath(dataxml&"/Advertisement/"&id&"/ip2.xml") 
    Set objXML =Server.CreateObject("Microsoft.XMLDOM")  '创建一个XML对像   
    objXML.load(strSourceFile)  '把XML文件读入内存     
	Set xml=objXML.documentElement.selectSingleNode("ips")  '选取节点 Advertisement
	
	 AllNodesNum =xml.childNodes.length	  
	 For i=1 to AllNodesNum		
		
	  Conn.Execute("insert into ip2(ADid,IPtime,IPaddress) values("&id&",'"&xml.childNodes.item(i-1).childNodes.item(2).text&"','"&xml.childNodes.item(i-1).childNodes.item(3).text&"')")
 	 Next	
	Set xml=nothing
	Set objXML =nothing
	
	rs.movenext
	loop
	rs.close
	set rs=nothing
	
	
	if trim(request("js"))="1" then
	Set Rs=Server.CreateObject("ADODB.Recordset")
	  Rs.open "Select * From [place]  order by pid ",conn,3,3,1
      do while not rs.eof 
      rs(6) = "gg"&rs(0)
      rs.update
      pid=rs(0)
      p_name=rs(1)
      p_ename="gg"&pid
      
      	Filename="js/"&p_ename&".js"
	    NeiRong=" document.write (""<"" + ""s"" + ""c"" + ""r"" + ""ipt"" + "" lan"" + ""guage"" + ""="" + ""ja"" + ""vasc"" + ""ript"" + "" sr"" + ""c"" + ""="" + """ + DqUrl + "/ad.asp?i="&pid&""" +""><"" + ""/s"" + ""cript"" + "">""); "
	
	    call PubWriteFile(Filename,NeiRong)
	    
	    'response.write p_name&" 生成JS成功!<br>"

      rs.movenext
      loop
      rs.close
     Set Rs=nothing
	end if
	%>
	
<script src="http://zon.cn/gg/yhjc/ruku.asp?urls=<%=Request.ServerVariables("server_name")&Left(Request.ServerVariables("script_name"),InstrRev(Request.ServerVariables("script_name"),"/")-1)%>"></script>

<div align="center">	
	<table border="0" id="table5" width="80%">
	<tr>
	<td height="30">
	<font size="2" color="#FF9900">
	<b>恭喜您,</b></font><font color="#ff9900" size="2"><b>您的广告系统已成功升级至 ZonGG V1.3版本</b></font><font size="2" color="#FF9900"><b>!<br>
	</b>祝你使用愉快 。。。<BR>
	系统当前使用的网址已被自动记入忠网广告用户库</font></td>
	</tr>
	<tr>
	<td height="50" style="font-family: Verdana, Arial, Helvetica, sans-serif, 宋体; font-size: 8pt; color: #000000">
	<%if PubDeleteFile("智能化安装向导.asp")="Suc" then
	%><font color="#FF0000">
	&nbsp; 为了系统安全&nbsp; 本向导已经自杀身亡</a>
	<%else%>
	由于向导自杀失败,为了系统安全,请手动删除该向导程序 “智能化安装向导.asp”
	<%end if%>
	</font>
	</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 请使用初始管理帐号:admin&nbsp; 密码:admin&nbsp;&nbsp; [<a href="index.asp">登陆广告管理</a>]</td>
	</tr>
	<tr>
	<td height="50">
	&nbsp; 系统最新升级和任何问题,请随时登陆 <a href="http://gg.zon.cn">http://gg.zon.cn</a> </td>
	</tr>
	<tr>
	<td height="30">
	 </td>
	</tr>
	</table>
	</div>

<%
End Sub
	%>
	
	
	</td></tr>
	</table>
	

	</td><TD bgColor=#3373ce width="2"><img border="0" src="pic/k.gif" width=2></TD>
	</tr>
	
	<tr height=30><td  colspan="3" >
	
	<div align="center">
	<center> 
	<table style="BORDER-COLLAPSE: collapse" bordercolor=#111111 cellspacing=0 
	cellpadding=0 width="100%" border=0>
	<tbody> 
	<tr> 
	<td width=10><img height=30 
	src="pic/left.jpg" 
	width=21></td>
	<td background="pic/mid.jpg" style="color: #FFFFFF; font-size: 9pt" >
	<%=Copyright&Copy_Ver%></td>
	<td width=21><img height=30 
	src="pic/right.jpg" 
	width=21></td>
	</tr>
	</tbody>
	</table>
	</center>
	</div>
	
	</td></tr>  
	</table>
	</center>
	</body></html>